package com.ssm.maven.controller;

import java.util.ArrayList;

import javax.annotation.Resource;
 
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.ssm.maven.pojo.UserInf;
import com.ssm.maven.service.UserService;

@Controller
public class UserController {
	
	private UserService uService;
	 
	@Resource(name="userService")
	public void setuService(UserService uService) {
		this.uService = uService;
	}
    
	@RequestMapping("/user")
	public ModelAndView showUsers() {
		System.out.println("====");
		ModelAndView  mdv =new  ModelAndView("show");
		ArrayList<UserInf>  users = uService.getAllUsers(); 
	     mdv.addObject("user",users);
		return mdv;
	}
	 
}
